<template>
  <div class="listview-top">
    <img :src="playlist.coverImgUrl" alt="" class="bg">
    <div class="top">
      <div class="left">
        <img src="../assets/back.png" alt="" @click="$router.go(-1)">
        <span class="title">歌单</span>
      </div>
      <div class="right">
        <img src="../assets/search.png" alt="">
        <img src="../assets/more.png" alt="">
      </div>
    </div>
  </div>
  <div class="content">
    <div class="con-left">
      <img :src="playlist.coverImgUrl" alt="">
      <span class="count">{{ parseInt(playlist.playCount/10000) }}万</span>
    </div>
    <div class="con-right">
      <h3>{{ playlist.name }}</h3>
      <div class="author">
        <img :src="playlist.creator.avatarUrl" alt="" class="header">
        <span>{{ playlist.creator.nickname }}</span>
      </div>
      <div class="description">
        {{ playlist.description }}
      </div>
    </div>
  </div>
  <div class="icon-list">
    <div class="icon-item">
      <img src="../assets/comment.png" alt="">
      <span>{{ playlist.commentCount }}</span>
    </div>
    <div class="icon-item">
      <img src="../assets/share.png" alt="">
      <span>{{ playlist.shareCount }}</span>
    </div>
    <div class="icon-item">
      <img src="../assets/download.png" alt="">
      <span>下载</span>
    </div>
    <div class="icon-item">
      <img src="../assets/select.png" alt="">
      <span>多选</span>
    </div>
  </div>
</template>

<script>
import { toRefs } from 'vue'
export default {
  props: ['playlist'],
  setup(props) {
    const { playlist } = toRefs(props)

    return {
      playlist
    }
  }
}
</script>

<style lang="less" scoped>
.listview-top {
  width: 7.5rem;
  height: 0.8rem;
  font-size: 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 0.4rem;
  margin-top: 0.3rem;
  // background-color: pink;

  .bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 7.5rem;
    height: auto;
    z-index: -1;
    filter: blur(20px);
  }
  .top {
    width: 7.5rem;
    height: 0.8rem;
    display: flex;
    justify-content: space-between;
    .left {
      // float: left;
      display: flex;
    }
    .left,
    .right {
      color: #fff;
      .title {
        margin-left: 0.3rem;
        line-height: 0.8rem;
      }
      img {
        width: 0.8rem;
        height: 0.8rem;
      }
    }
    .right img {
      margin-left: 0.3rem;
    }
  }
}
.content {
  display: flex;
  justify-content: space-between;
  margin-top: 0.5rem;
  .con-left {
    position: relative;
    margin-left: 0.2rem;
    font-size: 0.3rem;
    img {
      width: 2.8rem;
      height: 2.8rem;
    }
    .count {
      position: absolute;
      top: 0;
      right: 0;
      color: #ccc;
    }
    .count::before {
      content: '❤ ';
    }
  }
  .con-right {
    width: 4rem;
    h3 {
      font-size: 0.35rem;
      color: #fff;
    }
    .author {
      display: flex;
      align-items: center;
      font-size: 0.3rem;
      color: #ccc;
      margin-top: 0.2rem;
      .header {
        width: 0.6rem;
        height: 0.6rem;
        border-radius: 0.3rem;
      }
    }
    .description {
      height: 0.8rem;
      font-size: 0.25rem;
      margin-top: 0.2rem;
      color: #ccc;
      overflow: auto;
      text-overflow: ellipsis;
      display: -webkit-box;
      -webkit-line-clamp: 2;
    }
  }
}
.icon-list {
  display: flex;
  justify-content: space-around;
  margin-top: 0.4rem;
  .icon-item {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #ccc;
    font-size: 0.3rem;
    img {
      height: 0.6rem;
      width: 0.6rem;
    }
  }
}
</style>